Analog class D audio amplifiers, also referred to as class D amplifiers, provide good power efficiency and quality output signals. Because of this, class D amplifiers are commonly used in low power applications and devices, such as portable battery powered devices. Further, analog class D audio amplifiers may reduce cost because they generally do not require an external inductance as output filter. The analog class D audio amplifiers typically use a pulse width modulator, which includes a triangular waveform generator. The triangular waveform produced by the waveform generator should be very linear, otherwise the output signal of the amplifier can be distorted.
FIG. 1 is a circuit diagram illustrating a prior art waveform generating circuit. The circuit receives a clock signal 102 and provides a triangular waveform signal as an output signal 104. The clock signal is a square wave signal.
The circuit includes an integrating circuit comprised of an op amp 106 and capacitor 108. The circuit additionally includes switchable current sources I1 110 and I2 112. Ideal circumstances include I1 and I2 being equal and the clock signal 102 to have an exact 50% duty cycle. Under these ideal circumstances, the output signal 104 is a triangular waveform with uniform characteristics including uniform peaks.
FIG. 2 is a timing diagram illustrating problems that can occur with the waveform generating circuit shown in FIG. 1. In situation 201, the current source I2 is greater than I1. As a result, the output signal 104 drifts towards a high peak value and away from a low peak value. It can be seen that the error increases every cycle. In situation 202, the current source I2 is less than I1. Here, the output signal 104 drifts towards the low peak value and away from the high peak value. Again, it can be seen that the error accumulates every cycle. In situation 203, the duty cycle of the clock signal 102 is not 100 percent. The low portion of the clock cycle is greater than the high portion of the clock cycle. As a result, the output signal 104 accumulates error and drifts towards to low peak value and has a non-uniform duty cycle.
In another prior art waveform generator, a triangular ramp is generated by two constant currents with opposite directions, which are sequentially switched to flow through a capacitor. The switches are controlled by two comparators monitoring the output voltage. An op-amp is utilized to build an integrator with the capacitor, which ensures constant voltage drop across the current sources in order to achieve an output signal with relatively high linearity. Additionally, the circuit is self oscillating and does not utilize an external or supplied clock signal. The output signal yielded is triangular and relatively linear, however it is single ended and not synchronized with an external clock.